#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
const int N = 1e6 + 5;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> b[i];
    }
    vector<int> tempa(n + 1, 0);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            tempa[i + 1] += a[j] - a[i];
        }
    }
    vector<int> tempb(n + 1, 0);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            tempb[i + 1] += b[j] - b[i];
        }
    }
    int ans = 0, x, y;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (tempa[i] - tempb[j] > ans) {
                ans = tempa[i] - tempb[j];
                x = i;
                y = j;
            }
        }
    }
    cout << x << " " << y << endl;
    return;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();

    return 0;
}